package javacore.v1ch5;

public class EnumTest {

    public static void main(String[] args) {
        Color c = Color.BLACK;
        System.out.println(c.getAbbreviation());
        System.out.println(c.name());
        System.out.println(c.ordinal());
    }
}

enum Color {
    RED("R"), GREEN("G"), BLACK("B");

    private Color(String abbreviation) {
        this.abbreviation = abbreviation;
    }

    public String getAbbreviation() {
        return abbreviation;
    }

    private String abbreviation;
}
